home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Strings / ConstCString.h < prev    next >
Text File  |  1997-06-28  |  974b  |  39 lines

  1. // ConstCString.h
  2.  
  3. #ifndef ConstCString_h
  4. #define ConstCString_h
  5.  
  6. #ifndef ConstData_h
  7. #include "ConstData.h"
  8. #endif
  9.  
  10. class ConstCString
  11.   {
  12.     private:
  13.         ConstData text;
  14.         
  15.         static uint32 CStringLength( const int8 * );
  16.          
  17.     public:
  18.         ConstCString( const int8 * );
  19.  
  20.         const uint8 *Start() const                            { return text.Start(); }
  21.         const uint8 *End() const                            { return text.End(); }
  22.  
  23.         uint32 Length() const                                { return text.Length(); }
  24.         URange32 Range() const                                { return text.Range(); }
  25.                 
  26.         bool IsEmpty() const                                    { return Length() == 0; }
  27.         
  28.         const uint8& operator[]( uint32 i ) const        { return text[i]; }
  29.         
  30.         ConstData Text() const                                { return text; }
  31.         ConstData Head( uint32 position ) const        { return text.Head( position ); }
  32.         ConstData Tail( uint32 position ) const        { return text.Tail( position ); }
  33.         ConstData Middle( URange32 range ) const        { return text.Middle( range ); }
  34.  
  35.         operator ConstData() const                            { return text; }
  36.   };
  37.  
  38. #endif
  39.